﻿@model Mvp.Mvc.Models.Google.SearchResult

@{
    ViewBag.Title = "Mount Vernon Plantation - Search Results";
}
<div class="post">
    @using(this.Html.BeginForm("Search", "Home"))
    {
	    <div class="entry">
			@this.Html.EditorFor(m => m.SearchQuery)
			<input type="submit" class="button" value="Search" />
		</div>
    }
</div>
<div class="post">
	<h2 class="title">Search Results for "@this.Model.SearchQuery"</h2>
	<div class="entry">
        @if (this.Model != null
            && this.Model.ResponseData != null
            && this.Model.ResponseData.Results != null
            && this.Model.ResponseData.Results.Count() > 0)
        {
            foreach (var result in this.Model.ResponseData.Results)
            { 
                <p>
                    <a href='@result.Url' target="_blank">@result.Title</a> - @result.Url
                </p>
            }
        }
        else
        {
            <p>No results found for "@this.Model.SearchQuery"</p>   
        }
    </div>
</div>
<div class="post">
    @using(this.Html.BeginForm("Search", "Home"))
    {
	<div class="entry">
			@this.Html.EditorFor(m => m.SearchQuery)
			<input type="submit" class="button" value="Search" />
		</div>
    }
</div>
